package me.eachann.session

import org.junit.Test

import org.junit.Assert.*
import java.util.concurrent.ConcurrentHashMap

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }
    @Test
    fun testMap(){
        val mCurrentFrequency = ConcurrentHashMap<String, Int>()
        val simpleName="String"
        mCurrentFrequency[simpleName] = mCurrentFrequency[simpleName]?.plus(1) ?: 1
        assertEquals(1,mCurrentFrequency[simpleName])
        mCurrentFrequency[simpleName] = mCurrentFrequency[simpleName]?.plus(1) ?: 1
        assertEquals(2,mCurrentFrequency[simpleName])
        val mCache = ConcurrentHashMap<String, Any>()
        mCache[simpleName]=mCache[simpleName]?:"Hello"
        assertEquals("Hello",mCache[simpleName])
    }
}
